package com.example.smartcity.ui.smartCity.activitytModule

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.MenuItem
import android.widget.TextView
import com.example.smartcity.R
import com.example.smartcity.logic.utils.BaseActivity

class SmShowActivity : BaseActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_sm_show)
        title = "文章详细"
        supportActionBar?.setDisplayHomeAsUpEnabled(true)

        // 接收数据
        val title = intent.getStringExtra("title")
        val contend = intent.getStringExtra("contend")
        val time = intent.getStringExtra("time")

        // 设置数据
        findViewById<TextView>(R.id.showTitle).text = title.toString()
        findViewById<TextView>(R.id.showContend).text = contend.toString()
        findViewById<TextView>(R.id.showTime).text = time.toString()
    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {
        this@SmShowActivity.finish()
        return super.onOptionsItemSelected(item)
    }
}